import $ from './assets/jquery.vendor'
import kendo from './assets/kendo.vendor'
import 'kendo-ui-core/js/kendo.binder'
import 'kendo-ui-core/js/kendo.fx'
import 'kendo-ui-core/js/kendo.router'
import 'kendo-ui-core/js/kendo.view'



import './public-resource/lib/ctp.jquery'
import './public-resource/lib/ctp.kendo'
import './public-resource/lib/ctp.app'

import 'kendo-ui-core/css/web/kendo.common.core.less';
import 'zui/dist/css/zui.css';


//import header from './public-resource/components/header/header'
//import list from './public-resource/components/list/list'
import './css/common.css';






const App = function(){
    /*$('.nav-top').html(header.tpl)
    $('#app').html(list.tpl)*/

    var headerModel = kendo.observable({
        navItems: [],
        title: "模板"
    });

    var layout = null //整体布局
    var headerView = null  //页面头
    var navItems = null;

    $.get("http://localhost:3003/navItems", function(result){

        navItems = result
        headerModel.set('navItems', navItems);


        layout = new kendo.Layout('layout-template');
        headerView = new kendo.View("header-template", {model: headerModel});

        function showAlways() {
            layout.showIn("#header", headerView);
        }

        layout.render("#application");
        showAlways();
    });
}
new App()